ENT.Type = "anim";
ENT.Base = "c_base_generator";

ENT.PrintName = "Oxygen Compressor";
ENT.Information = "Condition: On a planet with air.\nCondition: Linked to an energy container.";

ENT.Model = "models/props_citizen_tech/Firetrap_PropaneCanister01a.mdl";

ENT.Resource = RES_OXYGEN;
ENT.Amount = 5;
ENT.Delay = 0.1;

ENT.Required = { };
ENT.Required[RES_ENERGY] = 2;

ENT.CosmicPrice = 8;

function ENT:CanGenerate()
	
	return C.BreathablePlanet( self ) and self:AccessResource( RES_ENERGY, 2 );
	
end

function ENT:OnGenerate()
	
	local n = self:GetContainer( RES_ENERGY );
	
	if( n and n:IsValid() ) then
		
		n:RemoveResource( RES_ENERGY, self.Required[RES_ENERGY] );
		
	end
	
end